<?php

/* 
 * 任务模型
 * 未使用
 */
namespace Qwadmin\Model;
class TaskModel extends BaseModel {
    
	$_model='TaskModel';
    $_method='__construct';
    $_args='';
	$_runed=0;
	
	function __construct() {
      ///
	  
    } 
   
    public function gettask($)
	{
		
		
		
	}
   
    public function run()
	{
	  if($this->_runed!=0)return array('rsp'=>'err');
	  $obj=new $this->_model();
	  return $obj->$this->_method($args);
		
	}
   /**
     * 自动生成key
     */
    private function __authKey() {
        $str = 'ABC123456DEHJHIklmnopqrstJKL0123456789MNOPQRSTklmnopqrstUVWXY0123456789Zabcdefghijklmnopqrstuvwxyz0123456789';
        $len_str = strlen( $str );
        $key_str = '';
        for( $i = 1; $i <= 50; $i++ ) {
            $key_str .= $str[ rand( 0 , $len_str - 1 ) ];
        }
        if( $this->where(array('key' => $key_str ) )->find() ) {
            return $this->__authKey();
        }
        return $key_str;
    }
}

